//文件信息相关
console.log(__dirname);
console.log(__filename);

//console对象
console.error("错误信息控制台输出");

//process进程
console.log(process.env.PATH);
// console.log(proess.pid);
console.log(process.argv);

const myURL = new URL("/foo","https://example.com");
myURL.searchParams.append("key","value");
console.log(myURL.href);
//
let params = new URLSearchParams(myURL.searchParams);
params.append("key1","value1");
params.append("key2","ls");
console.log(params);
myURL.search = params;
console.log(myURL.href);
//Buffer对象
const buf = Buffer.from("r中国","utf-8");
const strBase64 = buf.toString("base64");
console.log(strBase64);
console.log(Buffer.from(strBase64,"base64").toString("utf-8"));
//定时器
let timer = setInterval(()=>{console.log('${new Date().toLocaleString()}');},1000);

//ctrl+c终止程序运行是事件处理 进程信号kill
process.on("SIGABRT",()=>{console.log("系统退出。。。");clearInterval(timer);});
//process.exit(0);